/*
 *NOTE:Auto generated service implement
 */
package com.surfilter.modules.prop.service.impl;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import com.surfilter.modules.prop.model.HtPropModel;
import com.surfilter.modules.prop.model.HtPropUserModel;
import com.surfilter.modules.prop.dao.HtPropDao;
import com.surfilter.modules.prop.dao.HtPropUserDao;
import com.surfilter.modules.prop.service.PropMgrService;
import com.surfilter.platform.base.model.ActionPermission;
import com.surfilter.platform.base.model.PageInfo;
import com.surfilter.platform.base.model.ParameterClassType;
import com.surfilter.platform.base.model.ParameterInfo;
import com.surfilter.platform.base.model.ParameterMapper;
import com.surfilter.platform.base.model.PermissionMethodType;
import com.surfilter.platform.base.service.ServiceBase;
import com.surfilter.platform.base.util.ParaUtil;

@Service(value = "propMgrService")
public class PropMgrServiceImpl extends ServiceBase implements PropMgrService {

	@Resource
	private HtPropDao htPropDao;
	@Resource
	private HtPropUserDao htPropUserDao;

	@ActionPermission(actionName = "addHtProp", remark = "添加物业")
	public java.lang.Integer addHtProp(HtPropModel htPropModel,
			HttpServletRequest request) {
		return htPropDao.addHtProp(htPropModel);
	}

	@ActionPermission(actionName = "chgHtProp", remark = "修改物业")
	public void chgHtProp(HtPropModel htPropModel, HttpServletRequest request) {
		htPropDao.chgHtProp(htPropModel);
	}

	@ActionPermission(actionName = "delHtProp", remark = "")
	public void delHtProp(HtPropModel htPropModel, HttpServletRequest request) {
		htPropDao.delHtProp(htPropModel);
	}

	@ActionPermission(actionName = "getHtProps", remark = "获取所有物业信息", permission = PermissionMethodType.MODULE)
	public List<HtPropModel> getHtProps(HtPropModel htPropModel,
			HttpServletRequest request) {
		return htPropDao.getHtProps(htPropModel, PageInfo.getPageInfo(request));
	}

	@ActionPermission(actionName = "delHtProps", remark = "删除物业信息")
	public boolean delHtProps(HttpServletRequest request) {
		List<Integer> ids = ParaUtil.getJSONList(request, "ids", Integer.class);
		htPropDao.delHtProps(ids);
		return true;
	}

	@ActionPermission(actionName = "getHtPropsCount", remark = "",permission=PermissionMethodType.MODULE)
	public int getHtPropsCount(HtPropModel htPropModel) {
		return htPropDao.getHtPropsCount(htPropModel);
	}

	@ActionPermission(actionName = "addHtPropUser", remark = "添加物业人员")
	public java.lang.Integer addHtPropUser(HtPropUserModel htPropUserModel,
			HttpServletRequest request) {
		return htPropUserDao.addHtPropUser(htPropUserModel);
	}

	@ActionPermission(actionName = "chgHtPropUser", remark = "修改物业人员")
	public void chgHtPropUser(HtPropUserModel htPropUserModel,
			HttpServletRequest request) {
		htPropUserDao.chgHtPropUser(htPropUserModel);
	}

	@ActionPermission(actionName = "delHtPropUser", remark = "")
	public void delHtPropUser(HtPropUserModel htPropUserModel,
			HttpServletRequest request) {
		htPropUserDao.delHtPropUser(htPropUserModel);
	}

	@ActionPermission(actionName = "getHtPropUsers", remark = "获取所有物业人员",permission=PermissionMethodType.MODULE)
	public List<HtPropUserModel> getHtPropUsers(
			HtPropUserModel htPropUserModel, HttpServletRequest request) {
		return htPropUserDao.getHtPropUsers(htPropUserModel,
				PageInfo.getPageInfo(request));
	}
	@ActionPermission(actionName = "getHtPropUsersByPropId", remark = "获取物业下物业人员",permission=PermissionMethodType.ACTION)
	public List<HtPropUserModel> getHtPropUsersByPropId(
			 HttpServletRequest request) {
		Integer propid = ParaUtil.getPara(request, "propId", Integer.class);
		return htPropUserDao.getHtPropUsersByPropId(propid);
	}
	

	@ActionPermission(actionName = "delHtPropUsers", remark = "批量删除物业人员")
	public boolean delHtPropUsers(HttpServletRequest request) {
		List<Integer> ids = ParaUtil.getJSONList(request, "ids", Integer.class);
		htPropUserDao.delHtPropUsers(ids);
		return true;
	}

	@ActionPermission(actionName = "getHtPropUsersCount", remark = "")
	public int getHtPropUsersCount(HtPropUserModel htPropUserModel) {
		return htPropUserDao.getHtPropUsersCount(htPropUserModel);
	}

}
